<html>
<head>
<script>
function refresh() {
  img = document.getElementById('captcha');
  old_src = img.getAttribute('src');
  old_src = old_src.split('?')[0]
  img.setAttribute('src', old_src + '?a=' + String(Math.random()))
}
</script>
</head>
<body>
<form method="post">
{% csrf_token %}
<table>
{{ form }}
<tr>
  <th></th>
  <td>
    <img id="captcha" src="{% url "captcha" %}" onclick="refresh()">
  </td>
</tr>
</table>
<input type="submit" value="OK">
</form>
</body>
</html>
